home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
earcd
/
comm
/
tcp
/
miamilog.lha
/
MIAMIoff.miami
next >
Wrap
Text File
|
1997-02-24
|
2KB
|
81 lines
/*
$VER: MIAMILogbook.miami 1.0 (22 Feb 1997)
*/
/*
Varibles
'logfile' - Filename of the Logfile
*/
logfile = 'Miami_Time.log'
/* body */
/* get ONL time */
if open( date,'t:dateon',r ) then
do
datentp = readln( date )
call close( date )
address command 'C:Delete T:DateON'
end
else
say 'Datei nich gfunne !!!'
timentp = right( datentp,8 )
/* get Offlinetime */
address command 'C:Date >T:DateOFF'
if open( date,'t:dateoff',r ) then
do
dateold = READLN( date )
call close( date )
address command 'C:Delete T:DateOFF'
end
else
say 'Datei schowidda net gfunne !!!'
timeold = right( dateold,8 )
/* compare both times */
secntp = left( timentp,2 ) * 3600 + substr( timentp,4,2 ) *60 + right( timentp,2 )
secold = left( timeold,2 ) * 3600 + substr( timeold,4,2 ) *60 + right( timeold,2 )
secerror = secntp - secold
secerror = abs( secerror )
hh = right( '0' || trunc( secerror / 3600 ),2 )
mm = right( '0' || trunc( ( secerror - hh * 3600 ) / 60 ),2 )
ss = right( '0' || secerror - hh * 3600 - mm * 60,2 )
timeerror = '+'
timeerror = hh || ':' || mm || ':' || ss
error = word( datentp,2,1 ) || ' ' || timentp || ' ' || timeold || ' ' || timeerror
if ~open( log,logfile,r ) then
do
call open( log,logfile,w ) then
writeln( log,'Date Online Offline Time ' )
writeln( log,'--------- -------- -------- ---------' )
end
call close( log )
if open( log,logfile,a ) then
do
writeln( log,error )
call close( date )
address command 'C:Delete T:Date'
end
else
say 'Could not open "' || logfile || '" !!!'
exit